/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author Mr-Quick
 */
@Entity
@Table(name = "swhUser")
@NamedQueries({
    @NamedQuery(name = "SwhUser.findAll", query = "SELECT s FROM SwhUser s"),
    @NamedQuery(name = "SwhUser.findByIDUser", query = "SELECT s FROM SwhUser s WHERE s.iDUser = :iDUser"),
    @NamedQuery(name = "SwhUser.findByAccount", query = "SELECT s FROM SwhUser s WHERE s.account = :account"),
    @NamedQuery(name = "SwhUser.findByPassword", query = "SELECT s FROM SwhUser s WHERE s.password = :password"),
    @NamedQuery(name = "SwhUser.findByEmail", query = "SELECT s FROM SwhUser s WHERE s.email = :email"),
    @NamedQuery(name = "SwhUser.findByTypeUser", query = "SELECT s FROM SwhUser s WHERE s.typeUser = :typeUser"),
    @NamedQuery(name = "SwhUser.findByFullname", query = "SELECT s FROM SwhUser s WHERE s.fullname = :fullname"),
    @NamedQuery(name = "SwhUser.findByBirthday", query = "SELECT s FROM SwhUser s WHERE s.birthday = :birthday"),
    @NamedQuery(name = "SwhUser.findBySex", query = "SELECT s FROM SwhUser s WHERE s.sex = :sex"),
    @NamedQuery(name = "SwhUser.findByAge", query = "SELECT s FROM SwhUser s WHERE s.age = :age"),
    @NamedQuery(name = "SwhUser.findByCity", query = "SELECT s FROM SwhUser s WHERE s.city = :city"),
    @NamedQuery(name = "SwhUser.findByAddress", query = "SELECT s FROM SwhUser s WHERE s.address = :address"),
    @NamedQuery(name = "SwhUser.findBySecurity", query = "SELECT s FROM SwhUser s WHERE s.security = :security"),
    @NamedQuery(name = "SwhUser.findByActive", query = "SELECT s FROM SwhUser s WHERE s.active = :active")})
public class SwhUser implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IDUser")
    private String iDUser;
    @Basic(optional = false)
    @Column(name = "Account")
    private String account;
    @Basic(optional = false)
    @Column(name = "password")
    private String password;
    @Column(name = "Email")
    private String email;
    @Column(name = "TypeUser")
    private String typeUser;
    @Column(name = "Fullname")
    private String fullname;
    @Column(name = "birthday")
    @Temporal(TemporalType.TIMESTAMP)
    private Date birthday;
    @Column(name = "sex")
    private String sex;
    @Column(name = "age")
    private Integer age;
    @Column(name = "City")
    private String city;
    @Column(name = "Address")
    private String address;
    @Column(name = "Security")
    private String security;
    @Column(name = "active")
    private String active;
    @OneToMany(mappedBy = "iDUser")
    private List<Savemessage> savemessageList;
    @OneToMany(mappedBy = "iDUser")
    private List<House> houseList;

    public SwhUser() {
    }

    public SwhUser(String iDUser) {
        this.iDUser = iDUser;
    }

    public SwhUser(String iDUser, String account, String password) {
        this.iDUser = iDUser;
        this.account = account;
        this.password = password;
    }

    public String getIDUser() {
        return iDUser;
    }

    public void setIDUser(String iDUser) {
        this.iDUser = iDUser;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTypeUser() {
        return typeUser;
    }

    public void setTypeUser(String typeUser) {
        this.typeUser = typeUser;
    }

    public String getFullname() {
        return fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getSecurity() {
        return security;
    }

    public void setSecurity(String security) {
        this.security = security;
    }

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    public List<Savemessage> getSavemessageList() {
        return savemessageList;
    }

    public void setSavemessageList(List<Savemessage> savemessageList) {
        this.savemessageList = savemessageList;
    }

    public List<House> getHouseList() {
        return houseList;
    }

    public void setHouseList(List<House> houseList) {
        this.houseList = houseList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iDUser != null ? iDUser.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SwhUser)) {
            return false;
        }
        SwhUser other = (SwhUser) object;
        if ((this.iDUser == null && other.iDUser != null) || (this.iDUser != null && !this.iDUser.equals(other.iDUser))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.SwhUser[ iDUser=" + iDUser + " ]";
    }
    
}
